package com.gzj.environment.model.system.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @description:
 * @author: tsing
 * @create: 2021-01-22 21:21
 */
@Data
public class ResourceSaveDto {

    private Long id;

    @NotNull(message = "父资源id不能为空")
    private Long parentId;

    @NotBlank(message = "资源名称不能为空")
    @Length(min = 2, max = 20)
    private String name;

    @NotNull(message = "资源类型不能为空")
    @Min(1)
    @Max(2)
    private Integer type;

    private String url;
    private String permission;
    private String icon;

    @NotNull(message = "排序值不能为空")
    private Integer sort;

}
